package org.Vancl.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.Vancl.Dao.ShoppingAddressDao;
import org.Vancl.Dao.ImpI.ShoppingAddressDaoImpI;
@WebServlet(urlPatterns="/ajaxdelShoppingAddress.shtml")
public class ajaxdelShoppingAddressServlet extends HttpServlet {
		@Override
		protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
			String delid=req.getParameter("delid");
			ShoppingAddressDao addressDao=new ShoppingAddressDaoImpI();
			int rs=addressDao.delAddress(Integer.parseInt(delid));
			PrintWriter out=resp.getWriter();
			if(rs>0) {
				out.print(true);
			}else {
				out.print(false);
			}
		}
		@Override
		protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
			this.doGet(req, resp);
		}
}
